function MainAssistant(argFromPusher) {
}

MainAssistant.prototype = {
	setup: function() {
		Ares.setupSceneAssistant(this);
		
		this.divMethodCookie = new Mojo.Model.Cookie("divMethod");
		var divMethod = this.divMethodCookie.get();
		if (!divMethod) {
			divMethod = "three";
		}
		
		this.controller.listen('consultButton', Mojo.Event.tap, this.tappedConsultButton.bindAsEventListener(this));
		this.controller.listen('divinationMethodSelector', Mojo.Event.propertyChange, this.changedDivMethod.bindAsEventListener(this));
		
		this.divMethodModel.value = divMethod;
		this.controller.modelChanged(this.divMethodModel);
		this.changedDivMethod(this.divMethodModel);
		
	},
	cleanup: function() {
		Ares.cleanupSceneAssistant(this);
	},
	changedDivMethod: function(event) {
		switch (event.value) {
			case 'yarrow':
				this.controller.get('oldYangPercentTextField').mojo.setValue("1/16");
				oldYangProb = 1;
				this.controller.get('youngYinPercentTextField').mojo.setValue("7/16");
				youngYinProb = 7;
				this.controller.get('youngYangPercentTextField').mojo.setValue("5/16");
				youngYangProb = 5;
				this.controller.get('oldYinPercentTextField').mojo.setValue("3/16");
				oldYinProb = 3;
				this.divMethodCookie.put("yarrow");
				break;
			case 'three':
				this.controller.get('oldYangPercentTextField').mojo.setValue("1/8");
				oldYangProb = 1;
				this.controller.get('youngYinPercentTextField').mojo.setValue("3/8");
				youngYinProb = 3;
				this.controller.get('youngYangPercentTextField').mojo.setValue("3/8");
				youngYangProb = 3;
				this.controller.get('oldYinPercentTextField').mojo.setValue("1/8");
				oldYinProb = 1;
				this.divMethodCookie.put("three");
				break;
			case 'uniform':
				this.controller.get('oldYangPercentTextField').mojo.setValue("1/4");
				oldYangProb = 1;
				this.controller.get('youngYinPercentTextField').mojo.setValue("1/4");
				youngYinProb = 1;
				this.controller.get('youngYangPercentTextField').mojo.setValue("1/4");
				youngYangProb = 1;
				this.controller.get('oldYinPercentTextField').mojo.setValue("1/4");
				oldYinProb = 1;
				this.divMethodCookie.put("uniform");
				break;
			default:
				break;
		}
	},
	tappedConsultButton: function(event) {
		this.controller.stageController.pushScene('oracle');
		this.controller.get('questionTextField').mojo.setValue("");
	}
};